#include "tcpClient.hpp"
#include <memory>

using namespace std;
using namespace Client;

static void Usage(const std::string &proc)
{
    std::cout << "\nUsage:\n\t" << proc << " server_ip server_port" << std::endl
              << std::endl;
}

// ./tcpClient serverIP serverPort
int main(int argc, char* argv[])
{
    if (argc != 3)
    {
        Usage(argv[0]);
        exit(USAGE_ERROR);
    }
    
    string serverIP = argv[1];
    uint16_t port = atoi(argv[2]);

    // 1. 
    unique_ptr<tcpClient> utc(new tcpClient(serverIP, port));

    // 2.
    utc->init();

    // 3.
    utc->run();

    return 0;
}